import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: ()=>import('../views/login.vue')
    },
    {
      path:"/admin",
      name:"admin",
      component: ()=>import('../views/admin/Admin.vue'),
      children:[
        { name:"staff",
          path:"/permission/staffManagement",
          component:()=>import('../views/admin/permission/StaffManagemet.vue')
        },
        { name:"menu",
          path:"/menu/list",
          component:()=>import('../views/admin/permission/Menu.vue')
        },
        { name:"role",
          path:"/role/list",
          component:()=>import('../views/admin/permission/Role.vue')
        },
        { name:"station",
          path:"/station/list",
          component:()=>import('../views/busi/station/Index.vue')
        },{ name:"gun",
          path:"/station/charge/list",
          component:()=>import('../views/busi/station/Gun.vue')
        },{ name:"gunInfo",
          path:"/gun/list",
          component:()=>import('../views/busi/device/Index.vue')
        },
        { name:"alarm",
          path:"/alarm/list",
          component:()=>import('../views/busi/alarm/Index.vue')
        },
        { name:"coupon",
          path:"/coupon/list",
          component:()=>import('../views/busi/coupon/Index.vue')
        },
        { name:"couponQuery",
          path:"/couponQuery/list",
          component:()=>import('../views/busi/couponQuery/Index.vue')
        },
        { name:"exchangeCode",
          path:"/exchange/code/list",
          component:()=>import('../views/busi/exchangeCode/Index.vue')
        },
        { name:"chargingUser",
          path:"/charging/user/list",
          component:()=>import('../views/busi/charging/User.vue')
        },
        { name:"ChargingInvestor",
          path:"/investor/user/list",
          component:()=>import('../views/busi/charging/Investor.vue')
        },
        { name:"ChargingOrder",
          path:"/charging/order/list",
          component:()=>import('../views/busi/charging/Order.vue')
        },
        { name:"PayOrder",
          path:"/charge/pay/order/list",
          component:()=>import('../views/busi/charge/PayOrder.vue')
        },
        { name:"RefundOrder",
          path:"/charge/refund/order/list",
          component:()=>import('../views/busi/charge/RefundOrder.vue')
        },
        { name:"index",
          path:"/permission/index",
          component:()=>import('../views/index.vue')
        },
        {path:'',redirect:'/permission/index'}
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
